package com.sky.dto;

import com.sky.pojo.Employee;
import lombok.Data;
import org.springframework.beans.BeanUtils;
import org.springframework.context.annotation.Bean;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
public class EmployeeDTO implements Serializable ,Cloneable{

    private Long id;

    private String username;

    private String name;

    private String phone;

    private String sex;

    private String idNumber;

    @Override
    public Employee clone() throws CloneNotSupportedException {
        Employee employee = new Employee();
        BeanUtils.copyProperties(this,employee);
        employee.setUpdateTime(LocalDateTime.now());
        return employee;
    }
}
